package xyz.mumu233.robot;

import com.forte.qqrobot.component.forhttpapi.HttpApp;
import com.forte.qqrobot.component.forhttpapi.HttpApplication;
import com.forte.qqrobot.component.forhttpapi.HttpConfiguration;
import com.forte.qqrobot.sender.MsgSender;
import com.forte.qqrobot.utils.CQCodeUtil;
import xyz.mumu233.robot.enums.PropertiesEnum;
import xyz.mumu233.robot.util.ConfigUtil;

/**
 * @Author mumu
 * @create 2019/4/13 17:29
 */
public class Application implements HttpApp {

    @Override
    public void before(HttpConfiguration configuration) {
        configuration.setJavaPort(15514);
        configuration.setServerPath("/coolq");
        configuration.setServerPort(8877);
        configuration.setIp("localhost");
        configuration.setCqPath("D:\\酷Q Pro");
        configuration.setLocalQQCode("599119084");
    }

    @Override
    public void after(CQCodeUtil cqCodeUtil, MsgSender sender) {
        sender.SENDER.sendGroupMsg(ConfigUtil.properties.getProperty(PropertiesEnum.MANAGEGROUPIP.getKey()),"程序加载完毕");
    }

    public static void start(){
        new HttpApplication().run(new Application());
    }
}
